package cn.com.joyplus.wechat.listener;

import cn.com.joyplus.wechat.exceptions.WechatEventListenerException;
import cn.com.joyplus.wechat.model.WechatEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Created by 王灏川(wangrs@qq.com) on 2017/8/11 0011.
 *
 * 处理用户发给公众号的声音消息
 * <xml><ToUserName><![CDATA[gh_baaf1686e313]]></ToUserName>
 * <FromUserName><![CDATA[obWde08iJXKTezCCnERt39XphoAI]]></FromUserName>
 * <CreateTime>1501902205</CreateTime>
 * <MsgType><![CDATA[voice]]></MsgType>
 * <MediaId><![CDATA[ew_ucjq5cGi2RyU3xsDb94Yi-6ChQU0MkEhafd56JYFcnPX2SI7zKHWEcNzJB-fI]]></MediaId>
 * <Format><![CDATA[amr]]></Format>
 * <MsgId>6450620852702654297</MsgId>
 * <Recognition><![CDATA[]]></Recognition>
 * </xml>
 */
@Component
public class VoiceMessageListener implements IMsgListener {
    private static final Logger logger = LoggerFactory.getLogger(VoiceMessageListener.class);


    @Override
    public String process(WechatEvent event) throws WechatEventListenerException {
        logger.info(event.toString());
        return null;
    }
}